﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FJERP.BLL;
using FJERP.Model;

namespace FJERP.Handler
{
    /// <summary>
    /// Employee 的摘要说明
    /// </summary>
    public class Employee : IHttpHandler
    {
        EmployeeBLL bll = new EmployeeBLL();
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string action = context.Request["action"].ToString();
            System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(action);
            if (methodInfo != null)
            {
                methodInfo.Invoke(this, new object[] { context });
            }
        }
        public void Emp_Show(HttpContext context)
        {
            context.Response.Write(bll.Empoyee_Show());
        }
        public void EmployeeEdit(HttpContext context)
        {
            context.Response.Redirect("EmployeeEdit.aspx?id="+context.Request["id"].ToString());
        }
        public void Emp_Del(HttpContext context)
        {
            context.Response.Write(bll.Empoyee_Del(Convert.ToInt32(context.Request["id"])));
        }
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}